import { post, get } from '@/request/http'

// 分页查询设备
export function getWorkshopByPage (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnEquipment/getPageHnEquipment'
  return post(url, data)
}

// 添加生产线(车间)
export function addWorkshop (data) {
  const url = process.env.VUE_APP_CDHNTECH_API + '/hnEquipment/insertSelective'
  return post(url, data)
}

// 分页查询设备
export function deleteWorkshop (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnEquipment/deleteByPrimaryKey'
  return post(url, data)
}

// 根据id查询设备
export function getHnEquipmentById (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnEquipment/getHnEquipmentById'
  return get(url, data)
}

// 修改设备
export function updateWorkshop (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API +
    '/hnEquipment/updateByPrimaryKeySelective'
  return post(url, data)
}
// 查询所有企业及对应的生产线信息
export function getHnEntinfoAndWorkshop (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnEntinfo/getHnEntinfoAndWorkshop'
  return post(url, data)
}
// 添加生产线(车间)
export function insertSelective (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnWorkshop/insertSelective'
  return post(url, data)
}
// 修改生产线(车间)
export function updateByPrimaryKeySelective (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnWorkshop/updateByPrimaryKeySelective1'
  return post(url, data)
}
// 删除生产线(车间)
export function deleteByPrimaryKey (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnWorkshop/deleteByPrimaryKey'
  return post(url, data)
}
// 获取所有企业信息列表
export function queryHnEntinfoList (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnEntinfo/queryHnEntinfoList'
  return post(url, data)
}
// 企业ID查询生产线
export function queryHnWorkshopList (data) {
  const url =
    process.env.VUE_APP_CDHNTECH_API + '/hnWorkshop/queryHnWorkshopList'
  return post(url, data)
}
// 验证设备id是否重复
export function checkEquipmentId (data) {
  const url = process.env.VUE_APP_CDHNTECH_API + '/hnEquipment/checkEquipmentId'
  return get(url, data)
}
